import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;

//字节流读取和写入

public class Tio220054070558 {
    public static void main(String[] args) throws IOException {
        //读文件
        FileInputStream fis = new FileInputStream("D:\\Hello220054070558.java");
        //写文件
        FileOutputStream fos = new FileOutputStream("D:\\Hb220054070558.java");

        int temp = 0;
        int num = 0;
        while ((temp = fis.read()) != -1) {
            char ret = (char)temp;
            System.out.print(ret);
            num++;
            fos.write(temp);
        }
        System.out.println("读取到的字节数为："+num);
    }
}
